To perform time operations in SQL, You need to master four time functions: dateadd, datediff, datepart, and datename.Dateadd is to add or subtract a time on a specified date.For example, if you add a 3-day select dateadd (day, 3, '2017-05-06 ') on the specified date, the returned result is 2010-05-09.Datediff is the date and time parameter that returns two specif
Keywords: Oracle numeric function-type date conversion To_char automatic type conversion Date type numeric converter other function numeric functionABS: Find the absolute value function, such as: ABS (−5) 5SQRT: square root function, such as: sqrt (2) 1.41421356Power: exponentiation function, such as: 2,3 8COS: cosine trigonometric functions, such as: cos (3.1415
Single-record functions in SQL1. ASCIIReturns the decimal number corresponding to the specified character;SQL> select ascii ('A') A, ascii ('A') A, ascii ('0') zero, ascii ('') space from dual;A ZERO SPACE------------------------------------65 97 48 322. CHRReturns the corresponding characters;SQL> select chr (54740) zhao, chr (65) chr65 from dual;ZH C---Zhao3. CONCATConnect two strings;SQL> select concat ('010-', '000000') |' to 23' Gao Qian competin
()-- Dateadd (date part, value to be added, date): add the corresponding value according to the specified date part.Select dateadd (mm, 2, '2014/1/1') -- display 2013/2Select dateadd (YY,-2, '2014/1 ') -- display 2013/2-- Datediff (date part, date 1,
MySQL date functions and date conversion formatting functions, mysql Functions
Mysql is a free relational database with a huge user base. This article lists MYSQL common date functions
Common Oracle functions-date functions, oracle date functions
In the development and use of oracle, a variety of date functions are often used. The online
Oracle date functions:
Months_between: returns the difference of the month between two dates months_between ('01-EP-95 ', '11-Jan-94') ==> 19.6774194 add_months: Number of copies added to the date. add_months ('11-Jan-94 ', 6) ==> '11-JUL-94' next_day: Specifies the day after the date. next_day ('01-SEP-95 ', 'Friday'
Single record function in SQL 1. ASCII returns the decimal number corresponding to the specified character; SQLselectascii (A) A, ascii (a) a, ascii (0) zero, ascii () spacefromdual; The AAZEROSPACE------------------------------------659748322.CHR gives the integer, returns the corresponding character; SQLselect
Single record function in SQL 1. ASCII returns the decimal number corresponding to the specified character. SQL select ascii (A) A, ascii (a) a, ascii (0) zero, ascii () space from dual;
; SelECT extract (month from sysdate) from dual;
Select Extract (Day from sysdate) from dual;
Select extract (hour from timestamp ' 2015-10-1 17:22:22 ') from dual; Conversion functions: To_char (Date[,fmt[,params]):d ate: The date to convert, FMT: Format of conversion, params: The language of the date defaults to Dd
In PHP website development, the date and time fields in Mysql database design are essential because the date format output by Mysql date functions is not compatible with the date format between PHP date
Comparison between PHP and Java learning Date and Time Functions, phpjava date functions
Let's talk about PHP first.
Date ():Format a local time or date. The current time is 15:19:49, January 1, May 13, 2016.
Use the
character in a text field
Left (C,number_of_char)
Returns the left part of a requested text field
Right (C,number_of_char)
Returns the right part of a requested text field
ROUND (C,decimals)
Rounding the specified number of decimal digits for a numeric field
MOD (x, y)
Returns the remainder of a division operation
Now ()
Returns the current system date
Hive date functions, Hive date functions1. unix timestamp to Time Function
Syntax: from_unixtime (bigint unixtime [, string format]) Return Value: string Description: converts a UNIX timestamp (from 00:00:00 UTC to the specified time in seconds) to the current time zone for example: hive> select from_unixtime (1323308943, 'yyyymmdd') from dual; 201112082. Obtain
Common date functions in php [date addition and subtraction, difference between two dates, date conversion time cut] common date functions in php [date addition and subtraction, differe
SQL date functions
-- DATEADD-- Returns a new datetime value based on a specified date.-- DATEADD (datepart, number, date)-- Abbreviation of date-- Year yy, yyyy-- Quarter qq, q-- Month mm, m-- Dayofyear dy, y-- Day dd, d-- Week wk, ww-- Hour hh-- Minute mi, n-- Second ss, s
+name from Car; The query here will display the code and name two varchar type Lian as a string concatenation.Similarly, if it is a column of two value types, it will follow the mathematical operationConvert (type, column name) type conversionCast (column name as type)Time-Date functionGETDATE () Gets the current timeYear (GETDATE ()) Gets the years in the current timeMonth (GETDATE ()) Gets the months in the current timeDAT (GETDATE ()) DayIsDate (ti
Oracle function Daquan (string function, mathematical function, date function,: 25sql single record function 1. ASCII returns the decimal number corresponding to the specified character. SQL> select ASCII ('A') A, ASCII ('A') A, ASCII ('0') zero, ASCII ('') space from dual; A a zero space --------- 65 97 48 32
2. CHRReturns the corresponding characters;SQL> select CHR (54740) Zhao, CHR (65) chr65 from dual;Zh C---Zhao3. ConcatConnect two strings;SQL>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.